#柱状图类
from pyecharts.charts import Bar
#用来设置图表的标题
from pyecharts import options

sal = [12000,6000,3000,12000]
city = ["北京","南昌","九江","上海"]
#创建柱状图对象
bar = Bar()
#添加x轴数据
bar.add_xaxis(city)
#添加y轴数据
bar.add_yaxis("月薪/元",sal)
bar.set_global_opts(title_opts=options.TitleOpts(title="各城市平均薪水",subtitle="单位/元"))
#开始渲染页面
bar.render("baravg.html")